package com.example.springboottestservice.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class MyLogAspectJ {

    @Pointcut(value = "execution(* com.example.springboottestservice.aop.TestService.*(..))")
    public void pointcut(){}

    @Before(value = "pointcut()")
    public void logBefore(){
        System.out.println("...logBefore...");
    }

    @After(value = "pointcut()")
    public void logAfter(){
        System.out.println("...logAfter...");
    }
}
